API Documentation
IntVector.h
1 // IntVector.h
3 //
5 
6 namespace nkMaths
7 {
11  class IntVector : public ByteAlignedClass<16>
12  {
13  public :
14 
15  int _x ;
16  int _y ;
17  int _z ;
18  int _w ;
19 
20  public :
21 
26  IntVector () ;
35  IntVector (int x, int y) ;
45  IntVector (int x, int y, int z) ;
54  IntVector (int x, int y, int z, int w) ;
60  IntVector (const Vector& other) ;
66  IntVector (const IntVector& other) ;
67 
68  // Getters
72  int getX () const ;
76  int getY () const ;
80  int getZ () const ;
84  int getW () const ;
85 
86  // Setters
92  void setX (int value) ;
98  void setY (int value) ;
104  void setZ (int value) ;
110  void setW (int value) ;
111 
112  // Add
118  void addX (int value) ;
124  void addY (int value) ;
130  void addZ (int value) ;
136  void addW (int value) ;
142  void multX (int value) ;
148  void multY (int value) ;
154  void multZ (int value) ;
160  void multW (int value) ;
161 
162  // Length
166  float getLengthVec2 () const ;
170  float getLengthVec3 () const ;
174  float getLengthVec4 () const ;
180  float getLengthSquaredVec2 () const ;
186  float getLengthSquaredVec3 () const ;
192  float getLengthSquaredVec4 () const ;
193  // Distance
198  float getDistanceVec2 (const IntVector& other) const ;
203  float getDistanceVec3 (const IntVector& other) const ;
208  float getDistanceVec4 (const IntVector& other) const ;
215  float getDistanceSquaredVec2 (const IntVector& other) const ;
222  float getDistanceSquaredVec3 (const IntVector& other) const ;
229  float getDistanceSquaredVec4 (const IntVector& other) const ;
230 
231  // Practical
238  void fromString (const nkMemory::StringView& str) ;
239 
240  // Operators
247  IntVector& operator= (const IntVector& other) ;
254  IntVector& operator= (const Vector& other) ;
261  IntVector operator+ (const IntVector& other) const ;
267  void operator+= (const IntVector& other) ;
274  IntVector operator- (const IntVector& other) const ;
280  void operator-= (const IntVector& other) ;
287  IntVector operator* (const IntVector& other) const ;
293  void operator*= (const IntVector& other) ;
300  IntVector operator* (int coeff) const ;
306  void operator*= (int coeff) ;
313  IntVector operator/ (const IntVector& other) const ;
319  void operator/= (const IntVector& other) ;
326  IntVector operator/ (int coeff) const ;
332  void operator/= (int coeff) ;
339  bool operator== (const IntVector& other) const ;
346  bool operator< (const IntVector& other) const ;
353  bool operator<= (const IntVector& other) const ;
360  bool operator> (const IntVector& other) const ;
367  bool operator>= (const IntVector& other) const ;
368  } ;
369 }
nkMaths::IntVector::getDistanceVec3
float getDistanceVec3(const IntVector &other) const
nkMaths::IntVector::addW
void addW(int value)
nkMaths::IntVector::multZ
void multZ(int value)
nkMaths::IntVector::_w
int _w
W component of the vector.
Definition: IntVector.h:18
nkMaths::IntVector
A 4-component vector class, with integers.
Definition: IntVector.h:12
nkMaths::IntVector::getLengthVec2
float getLengthVec2() const
nkMaths::IntVector::addX
void addX(int value)
nkMaths::IntVector::getDistanceVec4
float getDistanceVec4(const IntVector &other) const
nkMaths::IntVector::IntVector
IntVector(int x, int y, int z, int w)
nkMaths::IntVector::multX
void multX(int value)
nkMaths::IntVector::setW
void setW(int value)
nkMaths::IntVector::operator+
IntVector operator+(const IntVector &other) const
nkMaths
Encompasses all API of component NilkinsMaths.
Definition: IntVector.h:7
nkMaths::IntVector::addZ
void addZ(int value)
nkMaths::IntVector::operator*=
void operator*=(const IntVector &other)
nkMaths::IntVector::operator<=
bool operator<=(const IntVector &other) const
nkMaths::IntVector::IntVector
IntVector(int x, int y)
nkMaths::IntVector::multW
void multW(int value)
nkMaths::IntVector::getLengthVec4
float getLengthVec4() const
nkMaths::IntVector::getDistanceVec2
float getDistanceVec2(const IntVector &other) const
nkMaths::IntVector::getZ
int getZ() const
nkMaths::IntVector::operator-=
void operator-=(const IntVector &other)
nkMaths::IntVector::IntVector
IntVector()
nkMaths::IntVector::addY
void addY(int value)
nkMaths::IntVector::getDistanceSquaredVec4
float getDistanceSquaredVec4(const IntVector &other) const
nkMaths::IntVector::operator/=
void operator/=(const IntVector &other)
nkMaths::IntVector::getLengthSquaredVec4
float getLengthSquaredVec4() const
nkMaths::IntVector::IntVector
IntVector(const Vector &other)
nkMaths::IntVector::IntVector
IntVector(int x, int y, int z)
nkMaths::IntVector::getY
int getY() const
nkMaths::IntVector::getDistanceSquaredVec2
float getDistanceSquaredVec2(const IntVector &other) const
nkMaths::IntVector::operator+=
void operator+=(const IntVector &other)
nkMaths::IntVector::getLengthSquaredVec3
float getLengthSquaredVec3() const
nkMaths::IntVector::_x
int _x
X component of the vector.
Definition: IntVector.h:15
nkMaths::IntVector::getX
int getX() const
nkMaths::IntVector::_z
int _z
Z component of the vector.
Definition: IntVector.h:17
nkMaths::IntVector::operator==
bool operator==(const IntVector &other) const
nkMaths::IntVector::setX
void setX(int value)
nkMaths::IntVector::setZ
void setZ(int value)
nkMaths::IntVector::getLengthSquaredVec2
float getLengthSquaredVec2() const
nkMaths::IntVector::_y
int _y
Y component of the vector.
Definition: IntVector.h:16
nkMaths::IntVector::operator-
IntVector operator-(const IntVector &other) const
nkMaths::IntVector::operator=
IntVector & operator=(const IntVector &other)
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkMaths::IntVector::operator>=
bool operator>=(const IntVector &other) const
nkMaths::IntVector::setY
void setY(int value)
nkMaths::IntVector::operator>
bool operator>(const IntVector &other) const
nkMaths::IntVector::operator*
IntVector operator*(const IntVector &other) const
nkMaths::IntVector::getDistanceSquaredVec3
float getDistanceSquaredVec3(const IntVector &other) const
nkMaths::IntVector::operator/
IntVector operator/(const IntVector &other) const
nkMaths::IntVector::multY
void multY(int value)
nkMaths::IntVector::operator<
bool operator<(const IntVector &other) const
nkMaths::IntVector::fromString
void fromString(const nkMemory::StringView &str)
nkMaths::IntVector::getLengthVec3
float getLengthVec3() const
nkMaths::IntVector::IntVector
IntVector(const IntVector &other)
nkMaths::Vector
A 4-component vector class, with floats.
Definition: Vector.h:12
nkMaths::IntVector::getW
int getW() const